package com.training.collections.vo;

import java.util.Comparator;

public class NameComparator implements Comparator<Employee> {

	@Override
	public int compare(Employee employee1, Employee employee2) {

		int result = employee1.getName().compareTo(employee2.getName());

		if (result == 0) {
			result = employee1.getId().compareTo(employee2.getId());
		}

		return result;
	}

}
